<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> 
    <title>下载</title>
    <link rel="stylesheet" href="<%=basePath%>static/css/sharestyle_active.css">
    <script src="<%=basePath%>static/js/sharetextjs_active.js"></script>
    <script src="<%=basePath%>static/js/jquery-3.2.1.min.js"></script>
</head>
<body bgcolor="#7062ee">
    <div class="register-bg">

        <div class="register-detail">
            <c:if test="${sharepic == null }">未查询到商家图片</c:if>
            <div class="download-banner" style="background:url(${sharepic});background-size: 9.6rem 13.6rem;">
            	<div class="download-btn">
            	    <c:if test="${parentid == 1}">
                	<a class="iphone" id="iphone">iPhone版 点击下载</a>
                	<a class="android" id="android">Android版 点击下载</a>
                	</c:if>
                	<c:if test="${parentid == 2}">
                	<a class="app" id="app">APP版 点击下载</a>
                	<a class="wx" id="wx">一键登录</a>
                	</c:if>
               	</div>
            </div>
        </div>
        
    </div>
    <script type="text/javascript">
        var u = navigator.userAgent;
        if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
            $(".android").on("click",function(){
                // 下载地址
                window.location.href = '${androidpath}';
                return false;
            })
                } 
        else if (u.indexOf('iPhone') > -1) {//苹果手机
            $(".iphone").on("click",function(){
                 // 跳出弹窗说明去Appstore里面下载
            	 window.location.href = '${iospath}';
                 return false;
            })
        } 
        
        $(".app").on("click",function(){
        	 if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
        		 window.location.href = '${androidpath}';
                 return false;
        	 }
        	 if (u.indexOf('iPhone') > -1) {//苹果手机
        		 window.location.href = '${iospath}';
                 return false;
        	 }
        });
        
        $(".wx").on("click",function(){
        	window.location.href = 'http://smms.sbdznkj.com:2018/SbdVoip/wxhtml/login1.html';
            return false;
        })
    </script>
</body>
</html>
